package d7_inerface_demo;

import java.util.ArrayList;

public class ClassManager {
    //定义容器存储全班学生对象
    private ArrayList<Student> students = new ArrayList<>();

    //在这里选择方案即可
    private StudentOperator studentOperator = new StudentOperatorImpl1();
    public ClassManager(){
      //  Student s1 = new Student("小红",'女',88);  可以像下面这样写
        students.add(new Student("小红",'女',88));
        students.add(new Student("小名",'男',89));
        students.add(new Student("小花",'女',98));
        students.add(new Student("小万",'男',99));
    }
// 要求i共两套方案来满足需求，  用接口来实现
    //打印全班全部学生的信息
    public void printInfo(){
        studentOperator.printAllInfo(students);
    }

    //打印全班全部学生的平均分
    public void printScore(){
        studentOperator.printAverageScore(students);

    }
}
